/**
 * @param {number[]} nums
 * @return {number}
 */
var findLengthOfLCIS = function (nums) {
  let len = nums.length
  if (!len) return 0
  let result = 1

  let left = 0, right = 1
  while (right < len) {
    if (nums[right - 1] >= nums[right]) {
      left = right
    }
    result = Math.max(result, right - left + 1)
    right++
  }

  return result
};

console.log(findLengthOfLCIS([1, 3, 5, 4, 7]));  // 4
